package model
{
	import localdb.dao.PageUpdateDAO;
	import localdb.table.PageUpdateTable;
	
	public class PageUpdateFactory
	{
		public function PageUpdateFactory(table: PageUpdateTable) {
			_table = table;
		}
		
		public function createPageUpdate(pageId:String="", diffText:String=""): PageUpdate {
			var pu: PageUpdateDAO = new PageUpdateDAO(_table);
			pu.pageId = pageId;
			pu.diffText = diffText;
			pu.modificationDate = new Date();
			return pu;
		}
		
		public function loadPageUpdate(PageId: String): PageUpdate {
			var pu: PageUpdateDAO = new PageUpdateDAO(_table, PageId);
			pu.load();
			return pu;
		}
		
		private var _table: PageUpdateTable;
	}
}